package com.itheima.exerciseTest.test10_19;

import java.util.Arrays;

public class Test15 {
    public static void main(String[] args) {
        String str = "  456 15 12 32 12 312 23 13 ";
        str = str.trim();

        String[] arrStr = str.split(" ");
        int[] arr = new int[arrStr.length];

        for (int i = 0; i < arr.length; i++) {
            int tamp = 0;
            try {
                tamp = Integer.parseInt(arrStr[i]);
            } catch (NumberFormatException e) {
                e.printStackTrace();
            }
            arr[i] = tamp;
        }

        String arrtoString = Arrays.toString(arr);
        System.out.println(arrtoString);

    }
}
